package cn.edu.ctbu.datafirst.service;

import cn.edu.ctbu.datafirst.domain.Student;
import cn.edu.ctbu.datafirst.repository.StudentRepository;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StudentService {

    @Autowired
    StudentRepository studentRepository;

    public List<Student> findAll(){


        return studentRepository.findAll();

    }

    public List<Student> findByName(String name){

        return studentRepository.findByName(name);
    }
}
